﻿@model Scorpicore.Models.Track

<h2>Промяна на следа</h2>


@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="form-horizontal">
        <legend>Следа</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="control-group">
            @Html.LabelFor(model => model.PlaceId, "Населено място", new { @class = "control-label" })
            <div class="controls">
                @Html.DropDownList("PlaceId", String.Empty)
                @Html.ValidationMessageFor(model => model.PlaceId, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="control-group">
            @Html.LabelFor(model => model.Message, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Message)
                @Html.ValidationMessageFor(model => model.Message, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="control-group">
            @Html.LabelFor(model => model.Date, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Date);
                @Html.ValidationMessageFor(model => model.Date, null, new { @class = "help-inline" })
                @Html.Kendo().Calendar().Name("admin-edit-track").Events(e => e.Change("change")).Culture("bg-BG");
            </div>
        </div>

        <div class="form-actions no-color">
            <input type="submit" value="Запази" class="btn" />
        </div>
    </fieldset>
}

<div>
    @Html.ActionLink("Назад", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script>
    function change() {
        console.log(kendo.toString(this.value(), 'dd/MM/yyyy'));
        console.log(kendo.toString(this.value(), 'd'));
        $("#Date").val(kendo.toString(this.value(), 'MM/dd/yyyy'))
    }
</script>